package com.ybkj.daijia.server.model;

import java.util.List;

/**
 * 收费金额类型提成详细表
 *
 * @author Shine
 */
public class DriverLevelMoneyTimeDetail extends Base {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private Integer startHour;// 开始时间 时

    private Integer startMinute;// 开始时间 分

    private Integer endHour;// 结束时间 时

    private Integer endMinute;// 结束时间 分

    private Long driverLevelId;

    private List<DriverLevelMoneyDetail> driverLevelMoneyDetails;

    public Integer getStartHour() {
        return startHour;
    }

    public void setStartHour(Integer startHour) {
        this.startHour = startHour;
    }

    public Integer getStartMinute() {
        return startMinute;
    }

    public void setStartMinute(Integer startMinute) {
        this.startMinute = startMinute;
    }

    public Integer getEndHour() {
        return endHour;
    }

    public void setEndHour(Integer endHour) {
        this.endHour = endHour;
    }

    public Integer getEndMinute() {
        return endMinute;
    }

    public void setEndMinute(Integer endMinute) {
        this.endMinute = endMinute;
    }

    public Long getDriverLevelId() {
        return driverLevelId;
    }

    public void setDriverLevelId(Long driverLevelId) {
        this.driverLevelId = driverLevelId;
    }

    public List<DriverLevelMoneyDetail> getDriverLevelMoneyDetails() {
        return driverLevelMoneyDetails;
    }

    public void setDriverLevelMoneyDetails(
        List<DriverLevelMoneyDetail> driverLevelMoneyDetails) {
        this.driverLevelMoneyDetails = driverLevelMoneyDetails;
    }

    public boolean isEmpty() {

        if (null == startHour || null == startMinute || null == endHour
            || null == endMinute) {
            return true;
        }
        return false;
    }

    public enum DriverLevelType {
        /**
         * 提成
         */
        ticheng,
        /**
         * 固定
         */
        guding
    }

//	public BigDecimal getCompanyTicheng(BigDecimal cost) {
//		
//		BigDecimal total=BigDecimal.ZERO;
//		
//		if(null!=cost){
//			
//			if(!CollectionUtils.isEmpty(driverLevelMoneyDetails)){
//				
//				for (DriverLevelMoneyDetail dlmd : driverLevelMoneyDetails) {
//					if(cost.doubleValue()>=dlmd.getFromMoney().doubleValue()){
//						
//						BigDecimal _money=BigDecimal.ZERO;
//						if(cost.doubleValue()>=dlmd.getToMoney().doubleValue()){
//							_money=dlmd.getToMoney().subtract(dlmd.getFromMoney());
//						}
//						else{
//							_money=cost.subtract(dlmd.getFromMoney());
//						}
//						
//						if(dlmd.getDriverLevelMoneyType().equals(DriverLevelMoneyType.guding)){//固定
//							total=total.add(dlmd.getMoney().multiply(new BigDecimal(Integer.parseInt(String.valueOf(_money.doubleValue()/dlmd.getMoneyUnit().doubleValue())))));
//						}
//						else if(dlmd.getDriverLevelMoneyType().equals(DriverLevelMoneyType.ticheng)){//比例
//							total=total.add(_money.multiply(dlmd.getCommission()).divide(new BigDecimal(100)));
//						}
//					}
//				}
//			}
//		}
//		
//		return total;
//	}

}
